<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>虚拟DOM与真实DOM</title>
    <!-- react核心组件库 -->
    <script src="../其他/js/react.development.js"></script>
    <script src="../其他/js/react-dom.development.js"></script>

    <!-- Don't use this in production: -->
    <script src="../其他/js/babel.min.js"></script>

</head>
</head>

<body>
    <div id="root"></div>


    <!-- 此处一定要写babel -->
    <script type="text/babel">
    // 第一种
        let VDOM = (
          <h1 id="title">
            <span>Hello, world!</span>
          </h1>
          )
        // 第二种
        // let VDOM = React.createElement('h1', {id: 'title'}, 'Hello, React')
        ReactDOM.render(VDOM, document.getElementById('root'));
        console.log(VDOM);
        // 虚拟dom本质就是一般的对象(object)
        // 虚拟dom较轻,没有真实懂吗那么多属性,最终会被转化成真实dom

    </script>
</body>

</html>